//
//  TitleForLeagueScoreRankViewCell.m
//  LiveSoftware
//
//  Created by lanou3g on 15/7/16.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//


/**
 *联赛积分排名  -----标题和球队
 */
#import "TitleForLeagueScoreRankViewCell.h"

@interface TitleForLeagueScoreRankViewCell ()


@property(nonatomic,strong)UIImageView *teamView;
@property(nonatomic,strong)UIView *titleView;


/**
 *全场
 */
@property(nonatomic,strong)UILabel*overallLabel;




/**
 *赛
 */
@property(nonatomic,strong)UILabel*gameLabel;


/**
 *胜
 */
@property(nonatomic,strong)UILabel *winLabel;


/**
 *平
 */
@property(nonatomic,strong)UILabel*drawLabel;




/**
 *负
 */
@property(nonatomic,strong)UILabel*lossLabel;





/**
 *得
 */
@property(nonatomic,strong)UILabel*getLabel;


/**
 *失
 */
@property(nonatomic,strong)UILabel *missLabel;


/**
 *积分
 */
@property(nonatomic,strong)UILabel*scoreLabel;




/**
 *排名
 */
@property(nonatomic,strong)UILabel*rankLabel;



/**
 *胜率
 */
@property(nonatomic,strong)UILabel*winPropLabel;


@end


@implementation TitleForLeagueScoreRankViewCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        
        float partX = kScreenIp6(10);
        float partHeight = 35;
        
       
        self.teamView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth,partHeight)];
        self.teamView.image = [UIImage imageNamed:@"header_view_bg"];
        
        [self.contentView addSubview:_teamView];
        
        
        //线
        UIView *lineView = [[UIView  alloc]initWithFrame:CGRectMake( 0, 0, kScreenWidth, 0.5)];
        
        lineView.backgroundColor = [UIColor colorWithWhite:0.699 alpha:1.000];
        
        [self.contentView addSubview:lineView];
        
        
        
        //球队
        self.teamName = [[UILabel alloc]initWithFrame:CGRectMake(partX, 0, kScreenWidth, partHeight)];
        self.teamName.font = [UIFont systemFontOfSize:14];
        
        [self.teamView addSubview:_teamName];
        
        
        
        
        self.titleView =[ [UIView alloc]initWithFrame:CGRectMake(0, partHeight, kScreenWidth, partHeight)];
        
        [self.contentView addSubview:_titleView];
        
        
        
        
        
        
        
        //开始高度
        float partY = 0;
        
        CGFloat leftWidth = kScreenIp6(45);
        CGFloat rightWidth = kScreenIp6(45);
        CGFloat partWidth = (kScreenWidth - leftWidth - rightWidth) / 8;
        
        
        //全场
        self.overallLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, partY, leftWidth + kScreenIp6(5), partHeight)];
        self.overallLabel.font = [UIFont systemFontOfSize:12];
        self.overallLabel.textAlignment = NSTextAlignmentCenter;
        self.overallLabel.text = @"全场";
        
        [self.titleView addSubview:_overallLabel];
        
        
        //赛
        self.gameLabel = [[UILabel alloc]initWithFrame:CGRectMake(leftWidth, partY, partWidth, partHeight)];
        self.gameLabel.font = [UIFont systemFontOfSize:12];
        self.gameLabel.textAlignment = NSTextAlignmentCenter;
        
        self.gameLabel.text = @"赛";
        
        [self.titleView addSubview:_gameLabel];
        
        
        //胜
        self.winLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self. gameLabel.frame), partY, partWidth, partHeight)];
        self.winLabel.font = [UIFont systemFontOfSize:12];
        self.winLabel.textAlignment = NSTextAlignmentCenter;
        
        self.winLabel.text = @"胜";
        
        [self.titleView addSubview:_winLabel];
        
        
        //平
        self.drawLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.winLabel.frame), partY, partWidth, partHeight)];
        self.drawLabel.font = [UIFont systemFontOfSize:12];
        self.drawLabel.textAlignment = NSTextAlignmentCenter;
        
        self.drawLabel.text = @"平";
        [self.titleView addSubview:_drawLabel];
        
        
        
        
        //负
        self.lossLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.drawLabel.frame), partY, partWidth, partHeight)];
        self.lossLabel.font = [UIFont systemFontOfSize:12];
        self.lossLabel.textAlignment = NSTextAlignmentCenter;
        self.lossLabel.text = @"负";
        [self.titleView addSubview:_lossLabel];
        
        
        
        //得
        self.getLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.lossLabel.frame), partY, partWidth, partHeight)];
        self.getLabel.font = [UIFont systemFontOfSize:12];
        self.getLabel.textAlignment = NSTextAlignmentCenter;
        self.getLabel.text = @"得";
        [self.titleView addSubview:_getLabel];
        
        
        
        
        //失
        self.missLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.getLabel.frame), partY, partWidth, partHeight)];
        self.missLabel.font = [UIFont systemFontOfSize:12];
        self.missLabel.textAlignment = NSTextAlignmentCenter;
        self.missLabel.text = @"失";
        [self.titleView addSubview:_missLabel];
        
        //积分
        self.scoreLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.missLabel.frame), partY, partWidth, partHeight)];
        self.scoreLabel.font = [UIFont systemFontOfSize:12];
        self.scoreLabel.textAlignment = NSTextAlignmentCenter;
        self.scoreLabel.text = @"积分";
        [self.titleView addSubview:_scoreLabel];
        
        
        
        //排名
        self.rankLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.scoreLabel.frame), partY, partWidth, partHeight)];
        self.rankLabel.font = [UIFont systemFontOfSize:12];
        self.rankLabel.textAlignment = NSTextAlignmentCenter;
        self.rankLabel.text = @"排名";
        [self.titleView addSubview:_rankLabel];
        
        
        
        //胜率
        self.winPropLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.rankLabel.frame), partY, partWidth, partHeight)];
        self.winPropLabel.font = [UIFont systemFontOfSize:12];
        self.winPropLabel.textAlignment = NSTextAlignmentCenter;
        self.winPropLabel.text = @"胜率";
        [self.titleView addSubview:_winPropLabel];
        
        
        
        //线
        UIView *footLineView = [[UIView  alloc]initWithFrame:CGRectMake( 0, partHeight, kScreenWidth, 0.5)];
        
        footLineView.backgroundColor = [UIColor colorWithWhite:0.699 alpha:1.000];
        
        [self.titleView addSubview:footLineView];
        
        
        [self customTextColor];
        
        
        // 设置 cell 点击没有变化
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    
    
    return self;
    
}



- (void)customTextColor
{
    self.overallLabel.textColor = [UIColor grayColor];
    self.gameLabel.textColor = [UIColor grayColor];
    self.winLabel.textColor = [UIColor grayColor];
    self.drawLabel.textColor = [UIColor grayColor];
    self.lossLabel.textColor = [UIColor grayColor];
    self.getLabel.textColor = [UIColor grayColor];
    self.missLabel.textColor = [UIColor grayColor];
    self.scoreLabel.textColor = [UIColor grayColor];
    self.rankLabel.textColor = [UIColor grayColor];
    self.winPropLabel.textColor = [UIColor grayColor];
}


@end
